package com.lancoo.znbkxx.teacher.aibkGenerateTestPaper.aibkReplaceQues

import com.lancoo.znbkxx.teacher.aibkGenerateTestPaper.aibkReviewTestPaper.QuesReviewInforIndexHelp
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.TestPaperReplaceQuesInfor
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.TestPaperReviewInfor


object QuesReplaceInforIndexHelp {

    fun SortIndex_return_IndexB(testPaperReplaceQuesInfor: TestPaperReplaceQuesInfor, sortIndex: String): Int {
        var index_B = 0
        var replaceQuesListSize = testPaperReplaceQuesInfor.size
        outLoop@ for (a in 0 until replaceQuesListSize) {
            var childListSize = testPaperReplaceQuesInfor[a].ChildList.size
            for (b in 0 until childListSize) {
                val itemListSize = testPaperReplaceQuesInfor[a].ChildList[b].ItemList.size
                for (c in 0 until itemListSize) {
                    var itemSortIndex = testPaperReplaceQuesInfor[a].ChildList[b].ItemList[c].ItemSortIndex
                    if (itemSortIndex.contains(sortIndex)) {
                        index_B = b
                        break@outLoop
                    }
                }
            }
        }
        return index_B
    }

//    //通过小题序号 -> ItemSortIndex
//    fun ChildVpIndex_return_ItemSortIndex(testPaperReplaceQuesInfor: TestPaperReplaceQuesInfor, index_A: Int, childVpIndex: Int): String {
//        var itemSortIndex = ""
//        var childVpIndexK = -1
//        var itemListSize = testPaperReplaceQuesInfor[index_A].ChildList[childVpIndex].ItemList.size
//        outLoop@ for (c in 0 until itemListSize) {
//            childVpIndexK += 1
//            if (childVpIndexK == childVpIndex) {
//                itemSortIndex = testPaperReplaceQuesInfor[index_A].ChildList[childVpIndex].ItemList[c].ItemSortIndex
//                break@outLoop
//            }
//        }
//        return itemSortIndex
//    }
//
//    fun ItemSortIndex_return_ChildVpIndex(testPaperReplaceQuesInfor: TestPaperReplaceQuesInfor, itemsortIndex: String): Int {
//        var childVpIndex = -1
//        val replaceQuesListSize = testPaperReplaceQuesInfor.size
//        outLoop@ for (a in 0 until replaceQuesListSize) {
//            var childListSize = testPaperReplaceQuesInfor[a].ChildList.size
//            for (b in 0 until childListSize) {
//                var itemListSize = testPaperReplaceQuesInfor[a].ChildList[b].ItemList.size
//                for (c in 0 until itemListSize) {
//                    childVpIndex += 1
//                    val itemSortIndexA = testPaperReplaceQuesInfor[a].ChildList[b].ItemList[c].ItemSortIndex
//                    if (itemSortIndexA.contains(itemsortIndex)) {
//                        break@outLoop
//                    }
//                }
//            }
//        }
//        return childVpIndex
//    }

}